import { TOKEN,LOGINEDDATA } from "@/utils/stants";
import type { UserStateType } from "../stores/user";

export const saveTokenSync = (data:string) => {
  uni.setStorageSync(TOKEN, data);
};

export const getTokenSync = () => {
  return uni.getStorageSync(TOKEN);
};


export const setLoginedData = (data:string) => {
  uni.setStorageSync(LOGINEDDATA, data);
};

export const getLoginedData = ():UserStateType => {
  return JSON.parse(uni.getStorageSync(LOGINEDDATA));
};
